<template>
  <div class="search">
    <form action="/">
      <van-search
        v-model="value"
        show-action
        placeholder="请输入搜索关键词"
        @search="onSearch"
        @cancel="onCancel"
      />
    </form>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { showToast } from "vant";
import { reqSearch } from "@/api/home";
const value = ref("");
const onSearch = async (val) => {
  const result = await reqSearch(val);
  console.log(result);
};
const onCancel = () => history.back();
</script>

<style scoped></style>
